<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="models.Course"%>
<%@page import="models.User"%>
<%@page import="service.UserDao"%>
<%@page import="org.hibernate.Session"%>
<%@page import="service.HibernateUtil"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link href="style/tutor.css" type="text/css" rel="Stylesheet">
        <!-- include jQuery Library From Google Code -->
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
        
        <script type="text/javascript">
            $(document).ready(function(){
                $("#floatingMenu").click(function () {
                    $("#floatingMenu").css("visibility", "hidden");
                    $("#floatingMenuContent").slideDown(1000,function(){
                        $("#floatingMenuContent").click(function(){
                           $("#floatingMenuContent").slideUp(1000);
                           $("#floatingMenu").css("visibility", "visible"); 
                        });
                    });
                });
            });
        </script>
        <jsp:useBean id="inhoud" scope="application" class="models.Bean" />   
        <jsp:setProperty name="inhoud" property="language" value="<%= models.Bean.getLanguage() %>" />
        <title>
            Three 2 Learn
        </title>
    </head>
    <body>       
        <div id="wrapper">
            <jsp:include page="sidebar.jsp"/>
            <div id="right">
                <jsp:include page="courseDescriptionList.jsp"/>

                <div id="floatingMenu">                    
                    <jsp:setProperty name="inhoud" property="key" value="AssignedCourses" />
                    <jsp:getProperty name="inhoud" property="key" />
                </div>
                <div id="floatingMenuContent">
                    <c:choose>             
                        <c:when test="${not empty courses}">
                            <ul id="listCourses">
                                <c:forEach var="course" items="${courses}">
                                    <li>
                                        <a name="${course.courseID}" href="#">${course.getName()}</a>
                                    </li>
                                </c:forEach>
                            </ul>
                        </c:when>
                        <c:otherwise>
                            <jsp:setProperty name="inhoud" property="key" value="NoCoursesAssigned" />
                            <jsp:getProperty name="inhoud" property="key" />
                        </c:otherwise>
                    </c:choose>
                </div>
                
                <h1><jsp:setProperty name="inhoud" property="key" value="SelectACourse" />
                    <jsp:getProperty name="inhoud" property="key" /></h1>
                <c:forEach var="course2" items="${courses}">
                    <a href="/log?sc=${course2.courseID}">${course2.getName()}</a>
                </c:forEach>
                <h1><jsp:setProperty name="inhoud" property="key" value="SelectAStudent" />
                    <jsp:getProperty name="inhoud" property="key" /></h1>
                    <h2><jsp:setProperty name="inhoud" property="key" value="ChooseStudentForLog" />
                        <jsp:getProperty name="inhoud" property="key" /></h2>     
                
                <c:choose>
                    <c:when test="${not empty participantsOfCourse}">
                        <c:forEach var="participant" items="${participantsOfCourse}">
                            ${participant.getUserName()}
                        </c:forEach>
                    </c:when>
                    <c:otherwise>
                        <jsp:setProperty name="inhoud" property="key" value="NoCourseSelected" />
                        <jsp:getProperty name="inhoud" property="key" />
                    </c:otherwise>
                </c:choose>

            </div>
        </div>
    </body>
</html>